package com.link2room.aeriabots.service.impl;

import com.link2room.aeriabots.service.IMenuService;
import com.link2room.common.service.ICommonService;
import com.link2room.aeriabots.entity.WxOfficialAccountsMenu;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by LN on 2016/11/23.
 */
@Service("menuService")
@Transactional
public class MenuServiceImpl implements IMenuService {
    @Resource
    private ICommonService commonService;
    @Override
    public void updateMenu(List<WxOfficialAccountsMenu> updateEntitys , List<Long> deletList) throws Exception {
        commonService.saveOrUpdateList(updateEntitys);
        if(deletList != null){
            Object[] ids = deletList.toArray();
            commonService.delete(WxOfficialAccountsMenu.class,ids);
        }
    }
}
